<template>
  <el-container>

    <el-form :model="dataForm" ref="dataForm" :size="size" style="margin-left: 20px;margin-top: 20px">

      <div
        v-if="dataForm.obtainMode != null && dataForm.consumeMode == null || dataForm.consumeMode == ''"
        class="mb30"
      >
        <el-form-item label="获取/消耗方式：" prop="ruleName" class="w326" >
          <el-select
            v-model="dataForm.obtainName"
            :disabled="detailDis"
            :size="size"
          >
            <el-option
              v-for="item in obtainModeTypeList"
              :key="item.obtainMode"
              :label="item.obtainName"
              :value="item.obtainMode"
            ></el-option>
          </el-select>
        </el-form-item>
      </div>
      <div
        v-if="dataForm.consumeMode != null && dataForm.obtainMode == null || dataForm.obtainMode =='' "
        class="mb30"
      >
        <el-form-item label="获取/消耗方式：" prop="ruleName" class="w326" >
          <el-select
            v-model="dataForm.consumeName"
            :disabled="detailDis"
            :size="size"
          >
            <el-option
              v-for="item in consumeModeTypeList"
              :key="item.consumeMode"
              :label="item.consumeName"
              :value="item.consumeMode"
            ></el-option>
          </el-select>
        </el-form-item>
      </div>

      <el-row>
        <el-form-item label="规则名称："  prop="ruleName" class=" w326">
          <el-input
            v-model="dataForm.ruleName"
            auto-complete="off"
            :disabled="detailDis"
            maxlength="20"
            clearable
            style="width: 300px"
          ></el-input>
        </el-form-item>
      </el-row>
      <!--评价赠送-->
      <el-row  v-if="this.dataForm.obtainMode == 3">
        <el-form>
          <el-checkbox-group v-model="whetherPicList">
            <el-form-item >
              <!-- <span class="font">评价赠送</span> -->
              <el-row class="mb30">
                <el-checkbox label="带图" :disabled="detailDis"></el-checkbox>
              </el-row>
              <el-form-item class="mb30 w280" label="完成评价赠送：" :required="true" :show-message="false" label-width="129px">
                <!-- <span class="labelText color333 turnInlineBlock w129 t_r"><span style="color:red">*</span>完成评价赠送：</span> -->
                <el-input
                  placeholder="输入数字"
                  v-model="dataForm.havePictureMaxNum"
                  @input="dataForm.havePictureMaxNum=dataForm.havePictureMaxNum.replace(/[^\d.]/g,'')"
                  maxlength="5"
                  clearable
                  :disabled="detailDis"
                ></el-input>
                <span class="labelText turnInlineBlock m_l10 color333">积分</span>
              </el-form-item>
            </el-form-item>
            <el-form-item >
              <el-form-item class="mb30 w280" label="每日上限：" :required="true" :show-message="false" label-width="129px">
                <!-- <span class="labelText w125 color333">每日上限：</span -->
                <el-input
                  placeholder="输入数字"
                  v-model="dataForm.havePictureGiveGrowthNum"
                  @input="dataForm.havePictureGiveGrowthNum=dataForm.havePictureGiveGrowthNum.replace(/[^\d.]/g,'')"
                  maxlength="5"
                  clearable
                  :disabled="detailDis"
                ></el-input>
                <span class="labelText turnInlineBlock m_l10 color333">积分</span>
              </el-form-item>
            </el-form-item>

            <el-form-item >
              <el-row class="mb30">
                <el-checkbox label="不带图" :disabled="detailDis"></el-checkbox>
              </el-row>
              <el-form-item class="mb30 w280" label="完成评价赠送：" :required="true" :show-message="false" label-width="129px">
                <!-- <span class="labelText color333 turnInlineBlock w129 t_r"><span style="color:red">*</span>完成评价赠送：</span> -->
                <el-input
                  placeholder="输入数字"
                  v-model="dataForm.giveGrowthNum"
                  @input="dataForm.giveGrowthNum=dataForm.giveGrowthNum.replace(/[^\d.]/g,'')"
                  maxlength="5"
                  clearable
                  :disabled="detailDis"
                ></el-input>
                <span class="labelText turnInlineBlock m_l10 color333">积分</span>
              </el-form-item>
            </el-form-item>
            <el-form-item >
              <el-form-item class="mb120 w280" label="每日上限：" :required="true" :show-message="false" label-width="129px">
                <!-- <span class="labelText w125 color333"></span> -->
                <el-input
                  placeholder="输入数字"
                  v-model="dataForm.giveGrowthMaxNum"
                  @input="dataForm.giveGrowthMaxNum=dataForm.giveGrowthMaxNum.replace(/[^\d.]/g,'')"
                  maxlength="5"
                  clearable
                  :disabled="detailDis"
                ></el-input>
                <span class="labelText turnInlineBlock m_l10 color333">积分</span>
              </el-form-item>
            </el-form-item>
          </el-checkbox-group>
        </el-form>
      </el-row>
      <!--充值赠送-->
      <el-row  v-if="this.dataForm.obtainMode == 4">

        <el-form-item class="mb30">
          <el-radio-group v-model="dataForm.consumeFlag">
            <el-radio label="1" class="form-radio mr60" :disabled="detailDis">每充值赠送</el-radio>
            <el-radio label="2" class="form-radio" :disabled="detailDis">阶梯充值赠送</el-radio>
          </el-radio-group>
        </el-form-item>
        <!--  -->
        <el-form-item v-if="dataForm.consumeFlag==1">
          <el-form-item label="每充值：" prop="ruleName" label-width="117px" class="mb30">
            <el-input
              placeholder="请输入"
              clearable
              class="editDialogInput125"
              v-model="dataForm.consumeNum"
              @input="dataForm.consumeNum=dataForm.consumeNum.replace(/[^\d.]/g,'')"
              maxlength="5"
              :disabled="detailDis"

            ></el-input>
            <span class="font16 color333 turnInlineBlock m_l10">元，赠送</span>
            <el-input
              placeholder="请输入"
              clearable
              class="editDialogInput125"
              v-model="dataForm.giveIntegralNum"
              @input="dataForm.giveIntegralNum=dataForm.giveIntegralNum.replace(/[^\d.]/g,'')"
              maxlength="5"
              :disabled="detailDis"

            ></el-input>
            <span class="font16 color333 turnInlineBlock m_l10">积分</span>
          </el-form-item>
          <el-form-item label="每日上限：" prop="ruleName" class="mb120 w326" label-width="117px">
            <el-input
              placeholder="请输入"
              v-model="dataForm.giveIntegralMaxNum"
              @input="dataForm.giveIntegralMaxNum=dataForm.giveIntegralMaxNum.replace(/[^\d.]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"
            ></el-input>
          </el-form-item>
        </el-form-item>
        <!--  -->
        <el-form-item  v-if="dataForm.consumeFlag==2">
          <div v-for="(item,index) in dataForm.mememberIntegraIncrement" :key="index">
            <!-- <el-form-item  required> -->
            <el-form-item
              label="充值赠送："
              prop="ruleName"
              label-width="117px"
              class="mb30 turnInlineBlock"
            >
              <el-input
                type="text"
                v-model.number="dataForm.mememberIntegraIncrement[index].consumeNum"
                maxlength="5"
                placeholder="请输入"
                oninput="value=value.replace(/[^\d]/g,'')"
                clearable
                class="editDialogInput78 inputInner_paddingRight16"
                :disabled="detailDis"
              ></el-input>
              <span class="font16 color333 turnInlineBlock m_l10 mr10">元，赠送</span>
            </el-form-item>
            <el-form-item prop="giveIntegralNum" class="turnInlineBlock">
              <el-input
                type="text"
                v-model.number="dataForm.mememberIntegraIncrement[index].giveIntegralNum"
                maxlength="5"
                placeholder="请输入"
                oninput="value=value.replace(/[^\d]/g,'')"
                clearable
                class="editDialogInput78 inputInner_paddingRight16"
                :disabled="detailDis"
              ></el-input>
              <span class="font16 color333 turnInlineBlock m_l10">积分</span>
            </el-form-item>
            <el-button
              :size="size"
              type="text"
              @click="addOrderGivenStairArr(index)"
              v-show="index==0"
              :disabled="detailDis"
            >添加</el-button>
            <el-button
              :size="size"
              type="text"
              @click="deelteOrderGivenStairArr(index)"
              v-show="index != 0"
              class="textRed noMarginL"
              :disabled="detailDis"
            >删除</el-button>
            <!-- </el-form-item> -->
          </div>
          <el-form-item label="每日上限：" prop="ruleName" class="mb120 w326" label-width="117px">
            <el-input
              placeholder="请输入"
              v-model="dataForm.giveIntegralMaxNum"
              @input="dataForm.giveIntegralMaxNum=dataForm.giveIntegralMaxNum.replace(/[^\d.]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"
            ></el-input>
          </el-form-item>
        </el-form-item>
      </el-row>

      <!--下单赠送-->
      <el-row  v-if="this.dataForm.obtainMode == 1">

        <el-form-item class="mb30">
          <el-radio-group v-model="dataForm.orderFlag">
            <el-radio label="1" class="form-radio mr60" :disabled="detailDis">每消费赠送</el-radio>
            <el-radio label="2" class="form-radio" :disabled="detailDis">阶梯消费赠送</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item  v-if="dataForm.orderFlag==1">
          <!-- <span style="color:red">*</span> -->
          <el-form-item label="每消费：" prop="ruleName" label-width="128px" class="mb30 turnInlineBlock" >
            <el-input
              placeholder="请输入"
              clearable
              v-model="dataForm.consumeNum"
              class="editDialogInput125"
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              :disabled="detailDis"
            ></el-input>
            <span class="font16 color333 turnInlineBlock m_l10">元，赠送</span>
            <el-input
              placeholder="请输入"
              clearable
              v-model="dataForm.giveIntegralNum"
              maxlength="5"
              class="editDialogInput125"
              oninput="value=value.replace(/[^\d]/g,'')"
              :disabled="detailDis"
            ></el-input>
            <span class="font16 color333 turnInlineBlock m_l10">积分</span>
          </el-form-item>
          <el-form-item label="每日上限：" prop="ruleName" class="w326 mb120" label-width="128px">
            <el-input
              placeholder="请输入"
              v-model="dataForm.giveIntegralMaxNum"
              maxlength="5"
              clearable
              oninput="value=value.replace(/[^\d]/g,'')"
              :disabled="detailDis"
            ></el-input>
          </el-form-item>
        </el-form-item>
        <el-form-item  v-if="dataForm.orderFlag==2">
          <div v-for="(item,index) in dataForm.mememberIntegraIncrement" :key="index">
            <el-form-item class="formItemNoMargin">
              <el-form-item
                label="消费："
                prop="consumeNum"
                class="mb30 turnInlineBlock width267"
                label-width="128px"
              >
                <el-input
                  type="text"
                  v-model.number="dataForm.mememberIntegraIncrement[index].consumeNum"
                  maxlength="5"
                  placeholder="请输入"
                  class="editDialogInput78 inputInner_paddingRight16"
                  clearable
                  oninput="value=value.replace(/[^\d]/g,'')"
                  :disabled="detailDis"
                ></el-input>
                <span class="font16 color333">元，赠送</span>
              </el-form-item>
              <el-form-item prop="giveIntegralNum" class="turnInlineBlock">
                <el-input
                  type="text"
                  clearable
                  v-model.number="dataForm.mememberIntegraIncrement[index].giveIntegralNum"
                  maxlength="5"
                  placeholder="请输入"
                  class="editDialogInput78 inputInner_paddingRight16"
                  oninput="value=value.replace(/[^\d]/g,'')"
                  :disabled="detailDis"
                ></el-input>
                <span class="font16 color333 turnInlineBlock m_l10">积分</span>
              </el-form-item>
              <el-button
                :size="size"
                type="text"
                @click="addOrderGivenStairArr(index)"
                v-show="index==0"
                :disabled="detailDis"
              >添加</el-button>
              <el-button
                :size="size"
                type="text"
                class="textRed noMarginL"
                @click="deelteOrderGivenStairArr(index)"
                v-show="index != 0"
                :disabled="detailDis"
              >删除</el-button>
            </el-form-item>
          </div>
          <el-form-item label="每日上限：" prop="ruleName" label-width="128px" class="w326 mb120">
            <el-input
              placeholder="请输入"
              clearable
              v-model="dataForm.giveIntegralMaxNum"
              maxlength="5"
              :disabled="detailDis"
            ></el-input>
          </el-form-item>
        </el-form-item>
      </el-row>
      <!--注册赠送-->
      <el-row  v-if="this.dataForm.obtainMode == 2">
        <!-- <el-form-item>
          <span class="font">注册赠送</span>
        </el-form-item>-->
        <el-form-item label="用户注册发放：" prop="ruleName" class="w280 mb120" label-width="129px">
          <el-input
            placeholder="请输入"
            clearable
            v-model="dataForm.giveIntegralNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 tuenInlineBlock m_l10">积分</span>
        </el-form-item>
      </el-row>
      <!--消费抵现-->
      <el-row  v-if="this.dataForm.consumeMode == 1">
        <!-- <el-form-item >
          <span class="font">消费抵现</span>
        </el-form-item>-->
        <el-form-item label="订单消耗积分上限：" prop="ruleName" class="w200 mb120">
          <el-input
            placeholder="请输入"
            v-model="dataForm.consumeIntegralMaxNum"
            clearable
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"

          ></el-input>
          <span class="turnInlineBlock m_l10 font16 color333">积分</span>
        </el-form-item>
      </el-row>
      <!--兑换优惠券-->
      <el-row  v-if="this.dataForm.consumeMode == 2">
        <!-- <span class="font">兑换优惠券、红包</span> -->
        <el-form-item class="mb30">
          <el-radio-group v-model="dataForm.exchangeType">
            <el-radio label="1" class="form-radio mr60 color333" :disabled="detailDis">按比例兑换</el-radio>
            <el-radio label="2" class="form-radio color333" :disabled="detailDis">固定数额兑换</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item  v-if="dataForm.exchangeType ==1" class="mb120">
          <el-form-item label="兑换比例：" class="input100" label-width="128px" >
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeIntegral"
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"

            ></el-input>
            <span class="color333 font16 m_l10 mr5">积分</span>
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeMoney"
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"

            ></el-input>
            <span class="color333 font16 m_l10">金额</span>
          </el-form-item>
        </el-form-item>
        <el-form-item  v-if="dataForm.exchangeType == 2">
          <el-form-item label="消耗：" class="input100" label-width="116px">
            <el-input
              placeholder="请输入"
              v-model="dataForm.consumeIntegralNum"
              oninput="value=value.replace(/[^\d]/g,'')"
              clearable
              maxlength="5"
              class="mr10"
              :disabled="detailDis"
            ></el-input>
            <span class="color333 font16">积分，兑换优惠券/红包</span>
          </el-form-item>
          <el-form-item label="兑换优惠券/红包编码：" prop="ruleName" class="mb120 w150">
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeCouponRedEnvelopes"
              clearable
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              :disabled="detailDis"

            ></el-input>
          </el-form-item>
        </el-form-item>
      </el-row>
      <!--红包-->
      <el-row  v-if="this.dataForm.consumeMode == 3">
        <!-- <span class="font">兑换优惠券、红包</span> -->
        <el-form-item class="mb30">
          <el-radio-group v-model="dataForm.exchangeType">
            <el-radio :label="1" class="form-radio mr60 color333" :disabled="detailDis">按比例兑换</el-radio>
            <el-radio :label="2" class="form-radio color333" :disabled="detailDis">固定数额兑换</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item  v-if="dataForm.exchangeType ==1" class="mb120">
          <el-form-item label="兑换比例：" prop="ruleName" class="input100" label-width="128px" >
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeIntegral"
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"
            ></el-input>
            <span class="color333 font16 m_l10 mr5">积分</span>
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeMoney"
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              clearable
              :disabled="detailDis"
            ></el-input>
            <span class="color333 font16 m_l10">金额</span>
          </el-form-item>
        </el-form-item>
        <el-form-item  v-if="dataForm.exchangeType == 2">
          <el-form-item label="消耗：" class="input100" label-width="117px" >
            <el-input
              placeholder="请输入"
              v-model="dataForm.consumeIntegralNum"
              oninput="value=value.replace(/[^\d]/g,'')"
              clearable
              maxlength="5"
              class="mr10"
              :disabled="detailDis"
            ></el-input>
            <span class="color333 font16">积分，兑换优惠券/红包</span>
          </el-form-item>
          <el-form-item label="兑换优惠券/红包编码：" prop="ruleName" class="mb120 w150">
            <el-input
              placeholder="请输入"
              v-model="dataForm.exchangeCouponRedEnvelopes"
              clearable
              oninput="value=value.replace(/[^\d]/g,'')"
              maxlength="5"
              :disabled="detailDis"
            ></el-input>
          </el-form-item>
        </el-form-item>
      </el-row>
      <!--点赞-->
      <el-row  v-if="this.dataForm.obtainMode == 6">
        <el-form-item label="完成点赞，赠送：" prop="ruleName" class="mb30 w200">
          <el-input
            placeholder="请输入"
            v-model="dataForm.giveIntegralNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            clearable
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
          <!-- <el-input placeholder="请输入" v-model="dataForm.giveIntegralMaxNum" oninput="value=value.replace(/[^\d]/g,'')" clearable maxlength="5" ></el-input><span>每日上限积分</span> -->
        </el-form-item>
        <el-form-item label="每日上限：" prop="ruleName" class="mb120 w200" label-width="128px">
          <el-input
            clearable
            placeholder="请输入"
            v-model="dataForm.giveIntegralMaxNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
        </el-form-item>
      </el-row>
      <!--晒单-->
      <el-row  v-if="this.dataForm.obtainMode == 7">
        <el-form-item label="完成嗮单，赠送：" prop="ruleName" class="mb30 w200">
          <el-input
            placeholder="请输入"
            v-model="dataForm.giveIntegralNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            clearable
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
          <!-- <el-input placeholder="请输入" v-model="dataForm.giveIntegralMaxNum" oninput="value=value.replace(/[^\d]/g,'')" clearable maxlength="5" ></el-input><span>每日上限积分</span> -->
        </el-form-item>
        <el-form-item label="每日上限：" prop="ruleName" class="mb120 w200" label-width="128px">
          <el-input
            clearable
            placeholder="请输入"
            v-model="dataForm.giveIntegralMaxNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
        </el-form-item>
      </el-row>
      <!--搜藏-->
      <el-row  v-if="this.dataForm.obtainMode == 8">
        <el-form-item label="完成收藏，赠送：" prop="ruleName" class="mb30 w200">
          <el-input
            placeholder="请输入"
            v-model="dataForm.giveIntegralNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
          <!-- <el-input placeholder="请输入" v-model="dataForm.giveIntegralMaxNum" oninput="value=value.replace(/[^\d]/g,'')" maxlength="5" style="width:200px"></el-input><span>每日上限积分</span> -->
        </el-form-item>
        <el-form-item label="每日上限：" prop="ruleName" class="mb120 w200" label-width="128px">
          <el-input
            clearable
            placeholder="请输入"
            v-model="dataForm.giveIntegralMaxNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
        </el-form-item>
      </el-row>
      <!--分享-->
      <el-row  v-if="this.dataForm.obtainMode == 5">
        <el-form-item label="完成分享，赠送：" prop="ruleName" class="mb30 w200">
          <el-input
            clearable
            placeholder="请输入"
            v-model="dataForm.giveIntegralNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
        </el-form-item>
        <el-form-item label="每日上限：" prop="ruleName" class="mb120 w200" label-width="128px">
          <el-input
            clearable
            placeholder="请输入"
            v-model="dataForm.giveIntegralMaxNum"
            oninput="value=value.replace(/[^\d]/g,'')"
            maxlength="5"
            :disabled="detailDis"
          ></el-input>
          <span class="font16 color333 turnInlineBlock m_l10">积分</span>
        </el-form-item>
      </el-row>

      <el-row>
        <el-form-item>
          <el-button
            :size="size"
            @click.native="returnRuleList"
            plain
            type="primary"
          >返回</el-button>
        </el-form-item>
      </el-row>
    </el-form>

  </el-container>
</template>
<script>
import KtButton from "@/views/Core/KtButton";
export default {
  components: {
    KtButton
  },
  data() {
    return {
      dataForm: {
        consumeIntegralNum: null,
        giveGrowthNum: null,
        havePictureMaxNum: null,
        havePictureGiveGrowthNum: null,
        giveGrowthMaxNum: null,
        giveType: null,
        actionType: null,
        giveMaxNum: null,
        consumeNum: null,
        giveNum: null,
        share: null,
        ruleId: null,
        ruleType: null,
        obtainMode: null,
        consumeMode: null,
        deptName: null,
        ruleName: null,
        ruleValue: null,
        consumeFlag: null,
        orderFlag: null,
        flag: null,
        exchangeType: 1,
        exchangeMoney: null,
        exchangeCouponRedEnvelopes: null,
        exchangeIntegral: null,
        giveIntegralNum: null,
        consumeIntegralMaxNum: null,
        giveIntegralMaxNum: null,
        consumeModeTypeList: [],
        obtainModeTypeList: [],
        mememberIntegraIncrement: [{ consumeNum: "", giveIntegralNum: "" }]
      },
      size: "mini",
      detailDis: true,
      obtainModeTypeList: [
        {
          "obtainMode": 1,
          "obtainName": "下单赠送"
        },{
          "obtainMode": 2,
          "obtainName": "注册赠送"
        },{
          "obtainMode": 3,
          "obtainName": "评价赠送"
        },
        {
          "obtainMode": 5,
          "obtainName": "分享赠送"
        },{
          "obtainMode": 6,
          "obtainName": "点赞赠送"
        },

        {
          "obtainMode": 8,
          "obtainName": "收藏赠送"
        },
      ],
      consumeModeTypeList: [
        {
          "consumeMode": 1,
            "consumeName": "消费抵现金"
        }
      ],
      whetherPicList:[],
      ruleId:this.$route.params.ruleId,
      ruleType:this.$route.params.ruleType,
      obtainMode:this.$route.params.obtainMode,
      consumeMode:this.$route.params.consumeMode,
    };
  },
  methods: {
    returnRuleList: function() {
      this.$router.push({path: '/pages/Member/IntegraRulelList'})
    },
    //查看方法
    handleDetail: function() {
      let this_ = this;

      let query = {};
      this.dataForm.ruleType = this.ruleType;
      this.dataForm.ruleId = this.ruleId;

      if (-1 != this.obtainMode) {

        this.dataForm.obtainMode = this.obtainMode;
        this.dataForm.consumeMode = null;
        this.obtainModeTypeList.find(item => {
          if (item.obtainMode == this_.obtainMode) {
            this.dataForm.obtainName = item.obtainName;
          }
        });
        query.obtainMode = this.obtainMode;
      } else if (-1 != this.consumeMode) {
        this.dataForm.obtainMode = null;
        this.dataForm.consumeMode =  this.consumeMode;
        this.consumeModeTypeList.find(item => {
          if (item.consumeMode == this_.consumeMode) {
            this.dataForm.consumeName = item.consumeName;
          }
        });
        query.consumeMode = this.consumeMode;
      }
      //查询数据渲染表格orderFlag
      query.ruleType = this.ruleType;
      query.ruleId = this.ruleId;

      this.utils.request.queryMemberIntegralInfo(query, function(res) {
        console.log(res)
        if (res.code == "0000") {

          this_.dataForm.deptName = res.data.deptName;
          this_.dataForm.ruleName = res.data.ruleName;
          this_.dataForm.consumeFlag = res.data.consumeFlag;
          if (
            res.data.actionType == 5 ||
            res.data.actionType == 6 ||
            res.data.actionType == 7 ||
            res.data.actionType == 8 ||
            res.data.actionType > 8
          ) {
            this_.dataForm.ruleId = res.data.ruleId;
            this_.dataForm.giveIntegralNum = res.data.giveIntegralNum;
            this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum;
          }

          if (query.obtainMode == 1) {
            this_.addDisabled=true;
            //下单赠送
            if (1 == res.data.consumeFlag) {
              this_.dataForm.orderFlag = "1";
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.consumeNum = res.data.consumeNum;
              this_.dataForm.giveIntegralNum = res.data.giveIntegralNum;
              this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum == 0 ? null : res.data.giveIntegralMaxNum;
            } else if (2 == res.data.consumeFlag) {
              this_.dataForm.orderFlag = "2";
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.consumeNum = null;
              this_.dataForm.giveIntegralNum = null;
              this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum == 0 ? null : res.data.giveIntegralMaxNum;
              this_.dataForm.mememberIntegraIncrement =
                res.data.mememberIntegraIncrement.length == 0
                  ? this_.dataForm.mememberIntegraIncrement
                  : res.data.mememberIntegraIncrement;
            }
          }

          if (query.obtainMode == 2) {
            //注册赠送
            this_.dataForm.ruleId = res.data.ruleId;
            this_.dataForm.consumeNum = res.data.consumeNum;
            this_.dataForm.giveIntegralNum = res.data.giveIntegralNum;
            this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum;
          }
          //
          if (res.data.actionType == 3) {

            //评价赠送赠送
            this_.dataForm.ruleId = res.data.ruleId;
            this_.whetherPicList = [];
            if (res.data.flag == 1) {
              this_.dataForm.flag = res.data.flag;
              this_.whetherPicList.push("带图");
              this_.dataForm.havePictureMaxNum = res.data.giveGrowthNum;
              this_.dataForm.havePictureGiveGrowthNum =
                res.data.giveGrowthMaxNum;
            }
            if (res.data.flag == 2) {
              this_.dataForm.flag = res.data.flag;
              this_.whetherPicList.push("不带图");
              this_.dataForm.giveGrowthMaxNum = res.data.giveGrowthMaxNum;
              this_.dataForm.giveGrowthNum = res.data.giveGrowthNum;
            }
            if (res.data.flag == 3) {
              this_.dataForm.flag = res.data.flag;
              this_.whetherPicList.push("带图");
              this_.whetherPicList.push("不带图");
              this_.dataForm.havePictureMaxNum = res.data.havePictureMaxNum;
              this_.dataForm.havePictureGiveGrowthNum =
                res.data.havePictureGiveGrowthNum;
              this_.dataForm.giveGrowthMaxNum = res.data.giveGrowthMaxNum;
              this_.dataForm.giveGrowthNum = res.data.giveGrowthNum;
            }
          }
          if (query.consumeMode == 1 || query.consumeMode > 8) {
            //消费抵现
            this_.dataForm.ruleId = res.data.ruleId;
            this_.dataForm.consumeIntegralMaxNum =
              res.data.consumeIntegralMaxNum;
          }
          if (query.obtainMode == 4) {
            //充值赠送
            if (1 == res.data.consumeFlag) {
              this_.dataForm.consumeFlag = "1";
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.consumeNum = res.data.consumeNum;
              this_.dataForm.giveIntegralNum = res.data.giveIntegralNum;
              this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum;
            } else {
              this_.dataForm.consumeFlag = "2";
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.giveIntegralMaxNum = res.data.giveIntegralMaxNum;
              this_.dataForm.mememberIntegraIncrement =
                res.data.mememberIntegraIncrement.length == 0
                  ? this_.dataForm.mememberIntegraIncrement
                  : res.data.mememberIntegraIncrement;
            }
          }

          if (query.consumeMode == 2) {
            //  兑换优惠券
            if (res.data.exchangeType == 1) {
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.exchangeIntegral = res.data.exchangeIntegral;
              this_.dataForm.exchangeType = 1;
              this_.dataForm.exchangeMoney = res.data.exchangeMoney;
            }
            if (res.data.exchangeType == 2) {
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.consumeIntegralNum = res.data.consumeIntegralNum;
              this_.dataForm.exchangeType = res.data.exchangeType;
              this_.dataForm.exchangeCouponRedEnvelopes =
                res.data.exchangeCouponRedEnvelopes;
            }
          }
          if (query.consumeMode == 3) {
            // 红包
            if (res.data.exchangeType == 1) {
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.exchangeIntegral = res.data.exchangeIntegral;
              this_.dataForm.exchangeType = 1;
              this_.dataForm.exchangeMoney = res.data.exchangeMoney;
            }
            if (res.data.exchangeType == 2) {
              this_.dataForm.ruleId = res.data.ruleId;
              this_.dataForm.consumeIntegralNum = res.data.consumeIntegralNum;
              this_.dataForm.exchangeType = res.data.exchangeType;
              this_.dataForm.exchangeCouponRedEnvelopes =
                res.data.exchangeCouponRedEnvelopes;
            }
          }
        }
      });
    },

  },
  mounted(){
    this.handleDetail()
  }
};
</script>

<style scoped lang='scss'>
  .type {
    display: flex;
    align-items: center;
  }
  .type p {
    text-align: right;
    margin-right: 20px;
    width: 120px;
  }
  .newUserOrder {
    margin-top: 2%;
    width: 20%;
    margin-left: 2%;
  }
  .font {
    font-size: 18px;
    font-weight: 800;
  }
  .ruleDes {
    color: #ffdead;
    font-size: 20px;
  }
  .positionDes {
    text-align: center;
    margin-top: 2%;
  }
  .ruleClass {
    font-size: 30px;
  }
  .everyCostHandleSel {
    /deep/ .el-input {
      width: 20%;
    }
  }
  .longInput {
    .timePicker {
      /deep/ .el-input {
        width: 201px !important;
      }
    }
  }
  .alignment {
    display: inline-block;
    height: 32px;
    line-height: 32px;
    font-size: 16px;
  }

  .input100 {
    /deep/ .el-input {
      width: 82px !important;
    }
  }
  .mb18 {
    margin-bottom: 18px;
  }

  .mt18 {
    margin-top: 18px;
  }

  // dialog标题的样式问题
  .span-title {
    font-size: 28px;
    color: #333333;
  }
  //下拉选择框icon对齐
  .iconAlignment {
    /deep/ .el-input__icon {
      line-height: 32px !important;
    }
  }
  .mb120 {
    margin-bottom: 120px !important;
  }
  .mr60 {
    margin-right: 60px !important;
  }
  /deep/ .w138 {
    width: 138px !important;
    /deep/ .el-input__inner {
      width: 138px !important;
    }
  }
  /deep/ .w350 {
    width: 350px !important;
    .el-input__inner {
      width: 350px !important;
    }
  }
  /deep/ .w365 {
    width: 365px !important;
    .el-input__inner {
      width: 365px !important;
    }
  }
  .textRed {
    color: red !important;
  }
  .noMarginL {
    margin-left: 0 !important;
  }
  .w70 {
    display: inline-block;
    width: 70px !important;
  }
  .colorOrange {
    color: #e7aa4e !important;
  }
  .turnInlineBlock {
    display: inline-block !important;
  }
  .successImg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
  }
  /deep/ .w115 {
    display: inline-block;
    width: 110px;
    text-align: right;
  }

  .mb40 {
    margin-bottom: 40px;
  }
  .labelText {
    color: #999999;
    font-size: 16px;
  }
  .w125 {
    display: inline-block;
    width: 125px;
    text-align: right;
  }
  .w90 {
    display: inline-block;
    width: 90px;
    text-align: right;
  }
  /deep/ .editDialogInput125 {
    width: 120px !important;
    /deep/ .el-input__inner {
      width: 120px !important;
    }
  }
  /deep/ .editDialogInput78 {
    width: 71px !important;
    /deep/ .el-input__inner {
      width: 71px !important;
    }
  }
  /deep/ .w275 {
    width: 275px !important;
    /deep/ .el-input__inner {
      width: 275px !important;
    }
  }
  .color000 {
    color: #000000;
  }
  .color333 {
    color: #333333;
  }
  .color666 {
    color: #666666;
  }
  .textColAlignment {
    display: inline-block;
    height: 32px;
    line-height: 32px;
  }
  .labelNoHeight {
    /deep/ .el-form-item__label {
      height: 0 !important;
    }
  }
  .p_d40 {
    padding-left: 21px;
  }
  .w200 {
    /deep/ .el-input {
      width: 200px !important;
      /deep/ .el-input__inner {
        width: 200px !important;
      }
    }
  }
  .errorInfoPosition {
    /deep/ .el-form-item__error {
      left: 112px;
    }
  }
  .labelTextColor666 {
    /deep/ .el-form-item__label {
      color: #666666;
    }
  }
  .formItemNoMargin {
    margin-bottom: 0 !important;
  }
  .form-item-content-noMargin {
    /deep/ .el-form-item__content {
      margin-right: 0 !important;
    }
  }
  .width280 {
    width: 280px !important;
  }
  .m_l5 {
    margin-left: 5px !important;
  }
  .m_l10 {
    margin-left: 10px !important;
  }
  /deep/ .textBtn {
    padding: 0 5px !important;
  }
  .mr5 {
    margin-right: 5px;
  }
  .w108 {
    width: 108px;
  }
  .w120 {
    width: 120px;
  }
  .labelMarginRight10 {
    /deep/ .el-form-item__label {
      margin-right: 10px !important;
    }
  }
  /deep/ .w356 {
    width: 356px !important;
    /deep/ .el-input__inner {
      width: 356px !important;
    }
  }

  .w150 {
    /deep/ .el-input {
      width: 150px !important;
      /deep/ .el-input__inner {
        width: 150px;
      }
    }
  }
  /deep/ .inputInner_paddingRight16 {
    /deep/ .el-input__inner {
      padding-right: 16px !important;
    }
  }
  .width267 {
    width: 267px !important;
  }
  .el-dialog-style {
    /deep/ .el-dialog {
      width: 610px;
      padding-left: 40px;
      padding-right: 40px;
      padding-bottom: 40px;
      .el-dialog__body {
        padding: 0;
        padding-top: 40px;
        /deep/ .el-form-item__label {
          margin-right: 0 !important;
        }
      }
    }
  }
  .search-input {
    .times {
      .times-to {
        padding: 0 10px;
        height: 32px;
        line-height: 32px;
        color: #999;
        display: inline-block;
      }
      /deep/ .el-input {
        width: 208px !important;
        .el-input__inner {
          width: 208px !important;
        }
      }
    }
  }
  .specicalTable{
    /deep/ .el-button{
      margin-left: 0 !important;
    }
  }
  .w109{
    width: 109px;
  }
  .w280{
    /deep/ .el-input{
      width: 280px !important;
      .el-input__inner{
        width: 280px;
      }
    }
  }
  .w129{
    width: 129px;
  }
</style>
